/*
 * registerFile.h
 *
 *  Created on: Feb 4, 2012
 *      Author: Craig Markham
 *		Class:  TCSS 371
 *		Assignment:
 */

#ifndef REGISTERFILE_H_
#define REGISTERFILE_H_
#endif /* REGISTERFILE_H_ */

#include "register.h"

typedef RegisterPtr RegisterFilePtr;

/*
 * =======================================================================================
 * RegisterFile implementation
 * =======================================================================================
 */

// allocates space for 16 register pointers and calls register_initialize for each slot
RegisterFilePtr registerFile_initialize();

// returns the byte in register reg_num and HOB or LOB indicated by which, sets error code
uchar registerFile_getByteFrom(RegisterFilePtr, uchar, uchar, int *);

// puts the byte into the reg_num and HOB or LOB indicated by which. returns error code
int registerFile_putByteTo(RegisterFilePtr, uchar, uchar, uchar);

// returns register content; sets error code
ushort registerFile_getRegValue(RegisterFilePtr, uchar, int *);

// puts the value into the designated reg_num register returns an error code
int registerFile_putRegValue(RegisterFilePtr, uchar, ushort);
